<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Company extends Model
{
    use HasFactory;

    protected $table = 'company'; // 指定表名
    protected $fillable = [
        'user_id',
        'company_name',
        'application_number',
        'address',
        'phone',
        'email',
        'status',
        'fraud_verif_time'
    ];
    protected $casts = [
        'fraud_verif_time' => 'datetime',
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
    ];

    const STATUS_ACTIVE = 1; // 活跃状态
    const STATUS_INACTIVE = 0; // 非活跃状态

    public static function active()
    {
        return self::query()->where('status',self::STATUS_ACTIVE);
    }   
    
}
